#include <bits/stdc++.h>

using namespace std;

const int N = 10;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int lights[N][N];
int n;

void dfs()
{
    
}

int main()
{
    cin >> n;
    while (n--)
    {
        for (int i = 0; i < 5; ++i)
        {
            for (int j = 0; j < 5; ++j)
            {
                cin >> lights[i][j];
            }
        }
         
    }
    return 0;
}